<template>
  <div class="app-container">
    <el-row>
      <el-col :span="16">
        <el-form ref="form" :model="userInfo" label-width="80px">
          <el-form-item label="工号：">
            <span>{{ userInfo.userId }}</span>
          </el-form-item>
          <el-form-item label="部门：">
            <span>{{ userInfo.organizationName }}</span>
          </el-form-item>
          <el-form-item label="岗位：">
            <span>{{ userInfo.positionName }}</span>
          </el-form-item>
          <el-form-item label="姓名：">
            <span>{{ userInfo.userName }}</span>
          </el-form-item>
          <el-form-item label="电话：">
            <span>{{ userInfo.mobile }}</span>
          </el-form-item>
          <el-form-item label="微信：">
            <span>002</span>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="8">
        <el-row>
          <img class="head-image" :src="$api.getDownloadServiceUrl(userInfo.photoDownloadCode)" alt="">
          <div>修改照片
            <input type="file">
          </div>
        </el-row>
      </el-col>
    </el-row>
    <div class="operate-container">
      <el-button type="primary">保存</el-button>
      <el-button @click="updatePassword">修改密码</el-button>
    </div>
  </div>
</template>

<script>

export default {
  name: 'UserInfo',
  data() {
    return {
      userInfo: {}
    }
  },
  computed: {},
  created() {
    this.userInfo = { ...this.$store.getters.userInfo }
  },
  methods: {
    updatePassword() {
      this.$addTab('updatePassword')
    }
  }
}
</script>

<style lang="scss" scoped>
  .head-image {
    width: 200px;
    height: 200px;
  }

  .operate-container {
    margin-top: 40px;
    text-align: right;
    padding-right: 20px;
  }
</style>
